package com.block.db.mapper;

import com.block.db.entity.MerchantDataPushInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 商户推送信息表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2023-08-12
 */
public interface MerchantDataPushInfoMapper extends BaseMapper<MerchantDataPushInfo> {

    MerchantDataPushInfo getEntityByOrderNoLock(String orderNo);

    MerchantDataPushInfo getEntityByOrderNoAndInfoIdLock(@Param("orderNo") String orderNo, @Param("infoId") Integer infoId);

    List<MerchantDataPushInfo> getWaitQueryPushDataList();

    MerchantDataPushInfo getEntityByOutOrderNoLock(@Param("infoId") String infoId, @Param("outOrderNo") String outOrderNo);

    Integer deleteInitStatusPushDataByDateInfo(@Param("dateInfo") String dateInfo);

    Integer deleteMatchFailedStatusPushDataByDateInfo(@Param("dateInfo") String dateInfo);

    Integer deleteMatchFailedStatusPushDataByDateTime(@Param("datetime") String datetime);

    void optimizeTable();

    BigDecimal getXhAmountByInfoIdAndDateInfo(@Param("infoId") Integer infoId, @Param("dateInfo")String dateInfo);

    List<MerchantDataPushInfo> selectMerchantDataPushInfoByUidAndInfoId(@Param("infoId")Integer infoId, @Param("uid") Long uid);

    List<MerchantDataPushInfo> selectMerchantDataPushInfoByUidAndInfoIdApiB(@Param("infoId")Integer infoId, @Param("uid") Long uid);
}
